package com.yunkazaixian.syntelecom.entity;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.ObjectUtil;

public class SessionInfo {
    private String iccid;
    private DateTime startTime;
    private DateTime endTime;
    private String status;
    private boolean processed = false; // 标记是否已批量处理

    // Getters and Setters
    public String getIccid() { return iccid; }
    public void setIccid(String iccid) { this.iccid = iccid; }
    public DateTime getStartTime() { return startTime; }
    public void setStartTime(DateTime startTime) { this.startTime = startTime; }
    public DateTime getEndTime() { return endTime; }
    public void setEndTime(DateTime endTime) { this.endTime = endTime; }
    public String getStatus() { return status; }
    public void setStatus(String status) { this.status = status; }
    public boolean isProcessed() { return processed; }
    public void setProcessed(boolean processed) { this.processed = processed; }

    // 计算状态
    public String calculateStatus() {
        if (ObjectUtil.isNotNull(startTime) && ObjectUtil.isNull(endTime)) {
            return "0"; // 在线
        } else if (ObjectUtil.isNotNull(startTime) && ObjectUtil.isNotNull(endTime)) {
            return "1"; // 离线
        }
        return null;
    }
}